﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using élénkPróbája.results;
using élénkPróbája.Test.extention;

namespace élénkPróbája.Test
{
    [TestClass]
    public class ValidationResultTest
    {
        [TestMethod]
        public void Should_be_valid_when_there_are_no_errors()
        {
            var result = new ValidationResult();
            result.IsValid.ShouldBeTrue();
        }

        [TestMethod]
        public void Should_not_be_valid_when_there_are_errors()
        {
            var result = new ValidationResult(new[] { new ValidationFailure(null, null), new ValidationFailure(null, null) });
            result.IsValid.ShouldBeFalse();
        }

        [TestMethod]
        public void Should_add_errors()
        {
            var result = new ValidationResult(new[] { new ValidationFailure(null, null), new ValidationFailure(null, null) });
            result.Errors.Count.ShouldEqual(2);
        }
    }
}
